using System;
using System.Collections.Generic;
using System.Text;
using IGCal.GA;
using IGCal.GA.BaseObjects;

namespace Calcio
{
  /// <summary>
  /// User settings (configurabile - user - in XML)
  /// </summary>
  public class UserSettings : IAfterInsertActionSetting
  {
     
    #region Serializzazione / Deserializzazione

    public void Serialize()
    {
#warning Tornare un errore eventualmente "ridefinito" (di solito non posso accedere in scrittura alla cartella) DA SIMULARE per vedere che cosa ritorna
      Globals.ConfigurableSettingsSerializer.Write(true, "Settings", "UserSettings", this);
    }

    public static UserSettings Deserialize()
    {
      object o = null;

      try
      {
        o = Globals.ConfigurableSettingsSerializer.Read(true, "Settings", "UserSettings", typeof(UserSettings));
      }
      catch { }

      if (o == null)
        return new UserSettings();
      else
        return (UserSettings)o;
    }

    #endregion

    #region IAfterInsertActionSetting Members

    private AfterInsertAction _AfterInsertAction = AfterInsertAction.Edit;

    public AfterInsertAction AfterInsertAction
    {
      get { return _AfterInsertAction; }
      set { _AfterInsertAction = value; }
    }

    #endregion


    #region Splitter Distance Gara
    private int _SplitterDistanceGara = -1;

    public int SplitterDIstanceGara
    {
        get { return _SplitterDistanceGara; }
        set { _SplitterDistanceGara = value; }
    }
	
    #endregion
}
}
